<template>
  <div>
    <grid-device :device="device" :show-param-list="showParamList" :show-explain-list="showExplainList" />
  </div>
</template>
<script>
import BaseView from '../../BaseView'
import { getDevice } from '@/api/iot/iotDeviceApi'
import GridDevice from '@/components/GridDevice'
import { getShowExplainList, getShowParamList } from '@/util/storage'
export default {
  name: 'IotDeviceInfo',
  components: {
    GridDevice
  },
  extends: BaseView,
  data() {
    return {
      deviceId: null,
      device: {},
      showParamList: getShowParamList(),
      showExplainList: getShowExplainList()
    }
  },
  mounted() {
    this.deviceId = this.detail.dataBind.deviceId
    this.getDevice()
  },
  methods: {
    getDevice() {
      getDevice({
        deviceId: this.deviceId
      }).then(res => {
        const { code, data } = res
        if (code === '200') {
          this.device = data
        }
      })
    }
  }
}
</script>

